package com.uriuniv.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.bind.ServletRequestUtils;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import com.uriuniv.service.StudentS;

public class CertificationC extends AbstractController {
	
	private StudentS studentS;
	private String successView;
	
	public void setStudentS(StudentS studentS) {
		this.studentS = studentS;
	}
	public void setSuccessView(String successView) {
		this.successView = successView;
	}

	@Override
	protected ModelAndView handleRequestInternal(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		
		String certificationKey = ServletRequestUtils.getStringParameter(request, "key", "");
		
		int result = studentS.certification(certificationKey);
		
		return new ModelAndView(successView);
	}
	
}
